package com.test.controller;

import javax.annotation.Resource;
//import javax.inject.Inject;
//import javax.inject.Named;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.test.entities.Employee;

@Controller
@RequestMapping("/welcome")
public class HelloController {

/*	@Inject
	@Named("nograde")
*/	@Resource(name="nograde")
	public String grade;

@Resource(name="rachitEmployee")
public Employee employee;
	
	@RequestMapping(method = RequestMethod.GET)
	public String printWelcome(ModelMap model) {
		
		Logger logger = Logger.getLogger(HelloController.class);
		logger.info("In the Hello Controller Class");

		model.addAttribute("message", "Spring 3 MVC Hello World");
		System.out.println(grade);
		System.out.println(employee.getEmployeeFirstName());
		return "hello";

	}

}